package com.kgc.scd.service.impl;

import com.kgc.scd.entity.ShopUserTLX;
import com.kgc.scd.mapper.ShopUserMapper;
import com.kgc.scd.mapper.ShopUserTLXMapper;
import com.kgc.scd.service.ShopUserServerService;
import com.kgc.scd.vo.ShopUserVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created On : 2022/11/16.
 * <p>
 * Author : Administrator
 * <p>
 * Description: ShopUserServerServiceImpl
 */
@Slf4j
@Service
public class ShopUserServerServiceImpl implements ShopUserServerService{


    @Autowired(required = false)
    private ShopUserTLXMapper shopUserMapper;
    @Override
    public ShopUserVO getShopUserById(String userId) {

        ShopUserVO shopUserVO=new ShopUserVO();
        ShopUserTLX shopUser = shopUserMapper.selectById(userId);
        log.info("SHopUser:"+shopUser);
        if (shopUser!=null){
            BeanUtils.copyProperties(shopUser,shopUserVO);
        }
        return shopUserVO;
    }

    @Override
    public void updateShopUserByEntity(ShopUserTLX shopUser) {

        shopUserMapper.updateById(shopUser);
    }
}
